package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HomeController {

    @RequestMapping("/")
    public String index() {
        System.out.println("---controller----");
        return "index";
    }

    @Auth
    @RequestMapping("/a")
    public String a() {
        return "a";
    }

    @RequestMapping("/b")
    public String b() {
        return "b";
    }
   /* @RequestMapping("/a")
    public String index2(HttpSession session){
        Object username = session.getAttribute("username");
        if (ObjectUtils.isEmpty(username)) {
            return "redirect:login";
        }
        return "a";
    }

    @RequestMapping("/b")
    public String index3(HttpSession session){
        Object username = session.getAttribute("username");
        if (ObjectUtils.isEmpty(username)) {
            return "redirect:login";
        }
        return "b";
    }*/
}
